import operator
class Probability(object):
    def __init__(self):
        self.domaindic = {}
        
        
    def createStructure():
        
    def resultshash():
        
        NUM_RECOMMEND=5
        session = []
        results_hash = {}
        probability_hash={}
        subdic = {}
        for domain in session:
            i=0
            while i<NUM_RECOMMEND:
                subdic = probability_hash.get(domain)
                candidate = max(subdic.iteritems(), key=operator.itemgetter(1))[0]
                if has_element(session, candidate)==0:
                    if not results_hash.has_key(candidate):
                        results_hash[candidate]=int(subdic.get(candidate))
                    else:
                        value = int(results_hash.get(candidate))
                        results_hash[candidate]=int(subdic.get(candidate))+value
                i+=1
                    
    
    
    def has_element(sessiondomains,test):
        if test in sessiondomains:
                return 1
        return 0
    
    def getTop():
        print 1
if __name__ == "__main__": resultshash()